{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "'\\nnetworks基础\\n\\nnetworkx是Python的一个包，用于构建和操作复杂的图结构，提供分析图的算法。\\n'"
      ]
     },
     "metadata": {},
     "execution_count": 1
    }
   ],
   "source": [
    "\"\"\"\n",
    "networks基础\n",
    "\n",
    "networkx是Python的一个包，用于构建和操作复杂的图结构，提供分析图的算法。\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import networkx as nx "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "g=nx.Graph()  #创建无向图\n",
    "#g=nx.DiGraph() #创建空的有向图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加节点\n",
    "g.add_node(1) #直接添加节点\n",
    "g.add_nodes_from([2,3,4])  #通过列表添加节点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "NodeView((1, 2, 3, 4))"
      ]
     },
     "metadata": {},
     "execution_count": 5
    }
   ],
   "source": [
    "g.nodes() #查看节点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"302.4pt\" version=\"1.1\" viewBox=\"0 0 446.4 302.4\" width=\"446.4pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2020-11-24T22:35:32.359369</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 302.4 \r\nL 446.4 302.4 \r\nL 446.4 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"PathCollection_1\">\r\n    <defs>\r\n     <path d=\"M 0 8.660254 \r\nC 2.296726 8.660254 4.499694 7.747755 6.123724 6.123724 \r\nC 7.747755 4.499694 8.660254 2.296726 8.660254 0 \r\nC 8.660254 -2.296726 7.747755 -4.499694 6.123724 -6.123724 \r\nC 4.499694 -7.747755 2.296726 -8.660254 0 -8.660254 \r\nC -2.296726 -8.660254 -4.499694 -7.747755 -6.123724 -6.123724 \r\nC -7.747755 -4.499694 -8.660254 -2.296726 -8.660254 0 \r\nC -8.660254 2.296726 -7.747755 4.499694 -6.123724 6.123724 \r\nC -4.499694 7.747755 -2.296726 8.660254 0 8.660254 \r\nz\r\n\" id=\"mf9e5d47b6a\" style=\"stroke:#1f78b4;\"/>\r\n    </defs>\r\n    <g clip-path=\"url(#pac732b54c0)\">\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"346.365479\" xlink:href=\"#mf9e5d47b6a\" y=\"282.109091\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"106.394611\" xlink:href=\"#mf9e5d47b6a\" y=\"20.290909\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"419.563636\" xlink:href=\"#mf9e5d47b6a\" y=\"68.686303\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"26.836364\" xlink:href=\"#mf9e5d47b6a\" y=\"262.448534\"/>\r\n    </g>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"pac732b54c0\">\r\n   <rect height=\"288\" width=\"432\" x=\"7.2\" y=\"7.2\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAALgElEQVR4nO3dsUpceRTA4XN1xAkkg7ArJGBgC1mn2kDSbBfTWptun8B9BGsfIXmCLa1tY7ptEkiaTILFQgYSMAGZCM4wo3cLcdngxiTeOzrr+b5W7/GA4I8Z595/UZZlGQCQxNRlLwAAF0n4AEhF+ABIRfgASEX4AEhF+ABIRfgASEX4AEhF+ABIRfgASKVx2QvwZR/2B7H5rBud973o9UfRaja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Q0aPtneiPDs91bX90GI+3d2reiLMIH0AFH/YH8fTN7pn/0ztLWUY8eb0bH/cH9S7GFwkfQAWbz7qVZxQRsfm8+hy+jfABVNB53/vsloXz6I+OovPuU00b8TXCB1BBrz+qac6wljl8nfABVNBq1nNXWKs5U8scvk74ACpo32zFbKPan9JmYyrat27UtBFfI3wAFazeW6g8o4yI1bvV5/BthA+ggh+vz8b9n+ejKM53fVEcn03qwdUXR/gAKvp9eTGajelzXdtsTMfa8mLNG3EW4QOo6M7tuVhface1me/7k3ptZirWV9rxy8LceBbjP3lINUANTh407XSGyedYIoAavezuxePtnXjyejeKOL45/cTJeXwPluZjbXnRK71LInwAY/BxfxCbz7vRefcpev1htJoz0b51I1bvOoH9sgkfAKn4cAsAqQgfAKkIHwCpCB8AqQgfAKkIHwCpCB8AqQgfAKkIHwCp/A1UpcfOWwhF5QAAAABJRU5ErkJggg==\n"
     },
     "metadata": {}
    }
   ],
   "source": [
    "#绘制节点\n",
    "import matplotlib.pyplot as plt \n",
    "nx.draw(g)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加属性\n",
    "g.add_node(5,name='scatter',weight=1)\n",
    "g.add_node(6,name='transform',weight=1.2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "{1: {},\n",
       " 2: {},\n",
       " 3: {},\n",
       " 4: {},\n",
       " 5: {'name': 'scatter', 'weight': 1},\n",
       " 6: {'name': 'transform', 'weight': 1.2}}"
      ]
     },
     "metadata": {},
     "execution_count": 7
    }
   ],
   "source": [
    "#查看属性\n",
    "g._node"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "{'name': 'scatter', 'weight': 1}"
      ]
     },
     "metadata": {},
     "execution_count": 8
    }
   ],
   "source": [
    "#查看指定节点属性\n",
    "g.nodes[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "NodeView((1, 2, 3, 4, 5, 6))"
      ]
     },
     "metadata": {},
     "execution_count": 9
    }
   ],
   "source": [
    "g.nodes()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "NodeDataView({1: {}, 2: {}, 3: {}, 4: {}, 5: {'name': 'scatter', 'weight': 1}, 6: {'name': 'transform', 'weight': 1.2}})"
      ]
     },
     "metadata": {},
     "execution_count": 10
    }
   ],
   "source": [
    "g.nodes(data=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "[(1, {}),\n",
       " (2, {}),\n",
       " (3, {}),\n",
       " (4, {}),\n",
       " (5, {'name': 'scatter', 'weight': 1}),\n",
       " (6, {'name': 'transform', 'weight': 1.2})]"
      ]
     },
     "metadata": {},
     "execution_count": 11
    }
   ],
   "source": [
    "list(g.nodes(data=True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "#删除指定节点属性\n",
    "del g.nodes[5]['name']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "{'weight': 1}"
      ]
     },
     "metadata": {},
     "execution_count": 13
    }
   ],
   "source": [
    "g.nodes[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "#向已有节点添加属性\n",
    "g.nodes[5]['name']='scatter'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "{'weight': 1, 'name': 'scatter'}"
      ]
     },
     "metadata": {},
     "execution_count": 15
    }
   ],
   "source": [
    "g.nodes[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 边\n",
    "# 可以理解为节点之间的连线，这里的边还可以加上属性与权重\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加边\n",
    "g.add_edge(2,3) #我节点2与节点3相连\n",
    "g.add_edges_from([(1,2),(1,3)]) #通过列表方式两两相连节点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "EdgeView([(1, 2), (1, 3), (2, 3)])"
      ]
     },
     "metadata": {},
     "execution_count": 18
    }
   ],
   "source": [
    "#查看边\n",
    "g.edges()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"302.4pt\" version=\"1.1\" viewBox=\"0 0 446.4 302.4\" width=\"446.4pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2020-11-24T22:36:22.859045</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 302.4 \r\nL 446.4 302.4 \r\nL 446.4 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"LineCollection_1\">\r\n    <path clip-path=\"url(#p2867481e1d)\" d=\"M 41.870226 20.290909 \r\nL 81.629358 21.73418 \r\n\" style=\"fill:none;stroke:#000000;\"/>\r\n    <path clip-path=\"url(#p2867481e1d)\" d=\"M 41.870226 20.290909 \r\nL 61.206315 46.776162 \r\n\" style=\"fill:none;stroke:#000000;\"/>\r\n    <path clip-path=\"url(#p2867481e1d)\" d=\"M 81.629358 21.73418 \r\nL 61.206315 46.776162 \r\n\" style=\"fill:none;stroke:#000000;\"/>\r\n   </g>\r\n   <g id=\"PathCollection_1\">\r\n    <defs>\r\n     <path d=\"M 0 8.660254 \r\nC 2.296726 8.660254 4.499694 7.747755 6.123724 6.123724 \r\nC 7.747755 4.499694 8.660254 2.296726 8.660254 0 \r\nC 8.660254 -2.296726 7.747755 -4.499694 6.123724 -6.123724 \r\nC 4.499694 -7.747755 2.296726 -8.660254 0 -8.660254 \r\nC -2.296726 -8.660254 -4.499694 -7.747755 -6.123724 -6.123724 \r\nC -7.747755 -4.499694 -8.660254 -2.296726 -8.660254 0 \r\nC -8.660254 2.296726 -7.747755 4.499694 -6.123724 6.123724 \r\nC -4.499694 7.747755 -2.296726 8.660254 0 8.660254 \r\nz\r\n\" id=\"md654f6ba26\" style=\"stroke:#1f78b4;\"/>\r\n    </defs>\r\n    <g clip-path=\"url(#p2867481e1d)\">\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"41.870226\" xlink:href=\"#md654f6ba26\" y=\"20.290909\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"81.629358\" xlink:href=\"#md654f6ba26\" y=\"21.73418\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"61.206315\" xlink:href=\"#md654f6ba26\" y=\"46.776162\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"328.417883\" xlink:href=\"#md654f6ba26\" y=\"245.711815\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"26.836364\" xlink:href=\"#md654f6ba26\" y=\"282.109091\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"419.563636\" xlink:href=\"#md654f6ba26\" y=\"52.393976\"/>\r\n    </g>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"p2867481e1d\">\r\n   <rect height=\"288\" width=\"432\" x=\"7.2\" y=\"7.2\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPf0lEQVR4nO3dUWid53nA8edYR9VRsFUFR2CDDYFq0enFYpAblmZQy+uFqS9WymzaQSBjsJY5sDJ8sQuziwaUEnqR3tjsoh4UDMtA0FwMlWwhlldS3Ay7sQOz7OnCYGV2kQyarFZH05HOLlTF9hzbss53pGM9vx8YbKTz6pEv9Oc7er/vLTUajUYAQBLbNnsAANhIwgdAKsIHQCrCB0Aq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U0EQET77LjfcuE7sn9P02s0IuLIYPPrALCiyB33zdpy4Xtue1cceKEv1nsIe6kUcXCgz60MAAUqcsd9s7Zc+CIiXh/qj0q5Y12vrZQ74thQf8ETAeTWTjvut2T49u3tjROHq9Hd+WTfXnfntjhxuBov7ultzWAASbXTjvstdzvDqtVtr4+6V2RVqbRypVf0vSIArGinHfdbNnwRK/F7cU9vnBqbiLNXp6IUd2+MjLh7Ht/Bgb44NtTvSg+gRVZ23N9q6u3Oonbcb+nz+O51e24hRi5OxvjNOzFbW4yeSmdUd++II4Otex4cACum5xbij9/6oKnwdZW3xS//7k+a/pm9pa/47rVze5dnbwJsktUd9/925TfruqWhyB33W3JzCwDtp1123AsfABuiXXbcp3mrE4DN1w477tNsbgGgfVyenNm0HffCB8Cm2Ywd98IHQCo2twCQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrw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Ho1ZfiketXipFVModceJwNV59+fmixwCABxT+VudK9K7E/OLyYz+30YiYX1yK4dErERHiB0DLFbq55dKNmRgeHV9T9O41v7gcw6PjcXlypshxAOABhYbv5NhE1OpL63ptrb4Up8YmihwHAB5QWPim5xbi3LWpR/5O71EajYizV6fi9txCUSMBwAMKC9/Ihcmm1yhFxMjF5tcBgIcpLHzjt2bvu2VhPWr15Ri/eaegiQDgQYWFb7ZWL2idxULWAYDPU1j4eirF3BnRU+ksZB0A+DyFha+6qye6ys0tVylvi+ruHQVNBAAPKix8R/bvaXqNRkQcGWx+HQB4mMLC99z2rjjwQl+USut7fakUcXCgz4OrAWipQm9gf32oPyrljnW9tlLuiGND/UWOAwAPKDR8+/b2xonD1ejufLJluzu3xYnD1XhxT2+R4wDAAwp/SPXqg6adzgBAO2rZeXyXJ2fi1NhEnL06FaVYuTl91ep5fAcH+uLYUL8rPQA2TMvCt+r23EKMXJyM8Zt3Yra2GD2Vzqju3hFHBp3ADsDGa3n4AKCdFLq5BQDanfABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZDK/wFR+O9Jx3GxCQAAAABJRU5ErkJggg==\n"
     },
     "metadata": {}
    }
   ],
   "source": [
    "nx.draw(g)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "#向边添加属性\n",
    "g.add_edge(1,2,weight=3,relationship='source')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "#直接通过预设函数添加权重\n",
    "g.add_weighted_edges_from([(1,2,0.4),(1,3,0.5),(2,3,1)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "#列表方式添加属性\n",
    "g.add_edges_from([(1,2,{'color':'red'}),(2,3,{'weight':1})])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "EdgeDataView([(1, 2, {'weight': 0.4, 'relationship': 'source', 'color': 'red'}), (1, 3, {'weight': 0.5}), (2, 3, {'weight': 1})])"
      ]
     },
     "metadata": {},
     "execution_count": 23
    }
   ],
   "source": [
    "#查看边属性\n",
    "g.edges(data=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "{'weight': 0.4, 'relationship': 'source', 'color': 'red'}"
      ]
     },
     "metadata": {},
     "execution_count": 24
    }
   ],
   "source": [
    "#查看指定边属性\n",
    "g[1][2] #方法一：通过列表索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "{'weight': 0.4, 'relationship': 'source', 'color': 'red'}"
      ]
     },
     "metadata": {},
     "execution_count": 25
    }
   ],
   "source": [
    "g.get_edge_data(1,2)  #方法二：通过get_edge_data函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "#删除边\n",
    "#边的数据结构是两个节点的id\n",
    "g.remove_edge(1,2)  #删除1，2之间的边"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"302.4pt\" version=\"1.1\" viewBox=\"0 0 446.4 302.4\" width=\"446.4pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2020-11-24T22:37:43.844621</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 302.4 \r\nL 446.4 302.4 \r\nL 446.4 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"LineCollection_1\">\r\n    <path clip-path=\"url(#p7b8ea895a2)\" d=\"M 125.984684 275.559397 \r\nL 69.745232 282.109091 \r\n\" style=\"fill:none;stroke:#000000;\"/>\r\n    <path clip-path=\"url(#p7b8ea895a2)\" d=\"M 26.836364 280.728918 \r\nL 69.745232 282.109091 \r\n\" style=\"fill:none;stroke:#000000;\"/>\r\n   </g>\r\n   <g id=\"PathCollection_1\">\r\n    <defs>\r\n     <path d=\"M 0 8.660254 \r\nC 2.296726 8.660254 4.499694 7.747755 6.123724 6.123724 \r\nC 7.747755 4.499694 8.660254 2.296726 8.660254 0 \r\nC 8.660254 -2.296726 7.747755 -4.499694 6.123724 -6.123724 \r\nC 4.499694 -7.747755 2.296726 -8.660254 0 -8.660254 \r\nC -2.296726 -8.660254 -4.499694 -7.747755 -6.123724 -6.123724 \r\nC -7.747755 -4.499694 -8.660254 -2.296726 -8.660254 0 \r\nC -8.660254 2.296726 -7.747755 4.499694 -6.123724 6.123724 \r\nC -4.499694 7.747755 -2.296726 8.660254 0 8.660254 \r\nz\r\n\" id=\"m0f4e3f643f\" style=\"stroke:#1f78b4;\"/>\r\n    </defs>\r\n    <g clip-path=\"url(#p7b8ea895a2)\">\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"125.984684\" xlink:href=\"#m0f4e3f643f\" y=\"275.559397\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"26.836364\" xlink:href=\"#m0f4e3f643f\" y=\"280.728918\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"69.745232\" xlink:href=\"#m0f4e3f643f\" y=\"282.109091\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"53.833013\" xlink:href=\"#m0f4e3f643f\" y=\"20.290909\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"344.571601\" xlink:href=\"#m0f4e3f643f\" y=\"35.864214\"/>\r\n     <use style=\"fill:#1f78b4;stroke:#1f78b4;\" x=\"419.563636\" xlink:href=\"#m0f4e3f643f\" y=\"204.379508\"/>\r\n    </g>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"p7b8ea895a2\">\r\n   <rect height=\"288\" width=\"432\" x=\"7.2\" y=\"7.2\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAANSElEQVR4nO3dT2jcZ3rA8Wek0WoEthBNROwgiZSqsZIFm9rbYNi0lkNhQfSoQKC+dA9ZcC7tqQffCjr0lJNNYE+FQAkItidRtmEtt1BCi921D7XsqhAs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K8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZBK9aAnAEBej9Y3Y/b6ciw8XIu1+nYM1qoxcWww3j8zEq8c6W/L56w0Go1GW0YGgN/i5tJqXJ5fjGt3VyIiYnN799n7atWeaETE5InhuHhuPE6NDhX6uYUPgI769IsvY2ZuIerbO7FfgSqViFq1Ny5NTcSFs28U9vn9qhOAjnkavduxsbX7wo9tNCI2tnZiZu52RERh8bO5BYCOuLm0GjNzC98ret+1sbUbM3MLcWt5tZB5CB8AHXF5fjHq2ztNPba+vRNX5hcLmYfwAdB2j9Y349rdlX2f09tPoxFx9c5KPF7fbHkuwgdA281eX255jEpEzN5ofRzhA6DtFh6uPfeShWbUt3dj4cGTlucifAC03Vp9u6BxtloeQ/gAaLvBWjGvnhus9bU8hvAB0HYTxwajv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XhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyCV/wVuqBGYL6IFowAAAABJRU5ErkJggg==\n"
     },
     "metadata": {}
    }
   ],
   "source": [
    "nx.draw(g)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}